<?php
	include 'db.php'; //database config and connection	
	$id = @$_GET['id'];
	$delall = @$_GET['delall'];
	if($id){
		$order = "DELETE FROM cart WHERE cartId='$id'";
		mysql_query($order);
		$order2 = "UPDATE cart_temp SET deleted = '1' WHERE cartId='$id'";
		mysql_query($order2);
	}else if($delall){
		$order = "DELETE FROM cart WHERE sessionID='$delall'";
		mysql_query($order);
		$order2 = "UPDATE cart_temp SET deleted = '1' WHERE sessionID='$delall'";
		mysql_query($order2);
	}
	
	header("location:products.php");
?>